package com.wsj.a.collapsingdemo;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.baidu.mobstat.StatService;
import com.wsj.a.collapsingdemo.databinding.ActivityMainBinding;
import com.wsj.a.collapsingdemo.ui.TestRefreshActivity;
import com.wsj.a.collapsingdemo.ui.TestRefreshLoadMoreActivity;
import com.wsj.a.collapsingdemo.ui.TextStyleActivity;


public class MainActivity extends AppCompatActivity {

    private ActivityMainBinding mBinding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = DataBindingUtil.setContentView(this,R.layout.activity_main);
        mBinding.setOnClick(this);
        mBinding.btnOne.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,ScrollingActivity.class);
                startActivity(intent);
            }
        });

        //百度统计
        StatService.setDebugOn(true);
        StatService.start(this);
    }

    public void goAdPager(View view){
       Intent intent = new Intent(MainActivity.this,AdvertiseActivity.class);
       startActivity(intent);
    }

    public void goWaterFallActivity1(View view){
        Intent intent = new Intent(MainActivity.this,WaterFallActivity.class);
        startActivity(intent);
    }


    public void goWaterFallActivity2(View view){
        Intent intent = new Intent(MainActivity.this,WaterFallActivity2.class);
        startActivity(intent);
    }

    public void goTextActivity(View view){
        Intent intent = new Intent(MainActivity.this, TextStyleActivity.class);
        startActivity(intent);
    }

    public void goToTestRefreshActivity(View view){
        Intent intent = new Intent(MainActivity.this, TestRefreshActivity.class);
        startActivity(intent);
    }

    public void goToTestRefreshAndLoadMoreActivity(View view){
        Intent intent = new Intent(MainActivity.this, TestRefreshLoadMoreActivity.class);
        startActivity(intent);
    }
}
